<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.lmpop.frame.util.PageTools"%>
<%@ page import="com.lmpop.trade.ts_category.*"%>
<%@ page import="com.lmpop.trade.tb_commpara.*"%>
<%@page import="com.lmpop.trade.ti_caseoperation.Ti_caseoperationInfo"%>
<%
	Map ti_case = new Hashtable();
	Ts_categoryInfo ts_categoryInfo = new Ts_categoryInfo();
	Map cmap = ts_categoryInfo.getAllChClass();
	Ti_caseoperationInfo caseoperInfo=new Ti_caseoperationInfo();
 	Tb_commparaInfo tb_commparaInfo = new Tb_commparaInfo(); 
 	String s_case_state = tb_commparaInfo.getSelectItem("113","");   
	String _cust_id="";
	if( session.getAttribute("session_cust_id") != null ){
		_cust_id = session.getAttribute("session_cust_id").toString();
		ti_case.put("lawyer_id",_cust_id);
	}
	String case_title = "";
	if (request.getParameter("case_title") != null
			&& !request.getParameter("case_title").equals("")) {
		case_title = request.getParameter("case_title");
		ti_case.put("case_title", case_title);
	}
	
	String case_state = "";
	if (request.getParameter("case_state") != null
			&& !request.getParameter("case_state").equals("")) {
		case_state = request.getParameter("case_state");
		ti_case.put("case_state", case_state);
	}
	
	String iStart = "0";
	int limit = 20;
	if (request.getParameter("iStart") != null)
		iStart = request.getParameter("iStart");
	List list = caseoperInfo.getListByLawyerCasePage(ti_case, Integer
			.parseInt(iStart), limit);
	int counter = caseoperInfo.getCountByLawyerCaseObj(ti_case);
	String pageString = new PageTools().getGoogleToolsBar(counter,
			"index.jsp?iStart=", Integer.parseInt(iStart), limit);
	 
%>

<html>

	<head>
		<title>律师案源查看</title>
		<link href="/program/member/index/css/style.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/engine.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/util.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/interface/Ts_categoryInfo.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/interface/Ti_LawyerInfo.js"></script>
		<script type="text/javascript" src="/js/commen.js"></script>
		<script type="text/javascript" src="ti_case.js"></script>

		
		<script type="text/javascript">setcat_attr1('');</script>
		<style type="text/css">
#thelayer{
 width:300px;height:98px;border:#E4F5FD 1px solid;z-index:2;position:absolute;background:#FFFFFF;display:none;
}
</style>
	</head>

	<body>
	<div id="thelayer"></div>
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td width="100%">
					<h1>
						律师案源查看
					</h1>
				</td>
			
			</tr>
		</table>

		<form action="index.jsp" name="indexForm" method="post">

<!-- 
			<table width="100%" cellpadding="0" cellspacing="0" class="dl_su">
				<tr>
					<td align="left">
						案源标题:
						<input name="case_title" id="case_title" type="text" />
						<input name="lawyer_id" id="lawyer_id" type="hidden" value="<%=_cust_id %>" />
						案源状态:
						<select name="scase_state" id="scase_state">
							<option value="">
								请选择
							</option>
							<%=s_case_state %>
						</select>
					<input name="searchInfo" type="submit" value="查询"
							onClick="search();" />
					</td>
				</tr>
				
			</table>
 -->
	<table width="100%" cellpadding="0" cellspacing="0" border="0"
				class="tablehe">
				<tr>
					<td>
						<%=pageString%>
					</td>
				</tr>
			</table>
			<table width="100%" cellpadding="0" cellspacing="0" border="0"
				class="listtab">
				<tr>
					
					<th  width="25%">
						案源标题
					</th>

					<th width="12%">
						案源状态
					</th>

					<th width="12%">
						 录入时间
					</th>

				</tr>

				<%
					int listsize = 0;
					if (list != null && list.size() > 0) {
						listsize = list.size();
						int length=0;
						List listtemp=null;
						for (int i = 0; i < listsize; i++) {
							Hashtable map = (Hashtable) list.get(i);
							String xcase_id = "",lawyer_name="",lawyer_id="",xcase_title = "",case_date="",xcase_type="", xuser_class = "", xcase_state = "", xcat_attr = "",operator_date="",lawyer_phone="",lawyer_company="";
							if (map.get("case_id") != null){
								xcase_id = map.get("case_id").toString();
							}
							if (map.get("case_title") != null){
								xcase_title = map.get("case_title").toString();
								if(xcase_title.length()>14)
									xcase_title=xcase_title.substring(0,14);
							}
							if (map.get("cur_state") != null){
								xcase_state = map.get("cur_state").toString();
								xcase_state = tb_commparaInfo.getSelectedValue("113",xcase_state); 
							}
							
								
							if (map.get("operator_date") != null)
								operator_date = map.get("operator_date").toString();
							 if(operator_date.length()>16)operator_date=operator_date.substring(0,16);	
							
						  if(map.get("operator_time") != null){
								case_date = map.get("operator_time").toString();
									case_date=case_date.substring(0,10);
							}
						 
				%>
				<tr>
					<td >
						<a href="select.jsp?case_id=<%=xcase_id%>"><%=xcase_title%></a>
					</td>
					<td >
							<%=xcase_state %>  
					</td>
				
						<td ><%=case_date%></td>				  
				</tr>
				<%
					}
					}
				%>
			</table>
			<table width="100%" cellpadding="0" cellspacing="0" border="0"
				class="tablehe">
				<tr>
					<td>
						<%=pageString%>
					</td>
				</tr>
			</table>

		</form>
	</body>

</html>